/**
 * Created by 李一方 on 2015/3/6.
 */
_prepareData: function () {
    this._data = this.getData();
    if (this._data.length == 0) {
        return;
    }
    this._data.sort(sortTagByName);
    var min = this._data[0].freq, max = this._data[0].freq;
    for (var i in this._data) {
        if (min > this._data[i].freq)
            min = this._data[i].freq;
        if (max < this._data[i].freq)
            max = this._data[i].freq;
    }

    console.log("max = " + max + ",  min = " + min);

    if (min == max) {
        var weight = Math.floor(this.bucketSize / 2);
        for (var i in this._data) {
            this._data[i].weight = weight;
        }
    } else {
        for (var i in this._data) {
            var freq = this._data[i].freq;
            var weight = Math.floor((Math.log(freq) - Math.log(min)) / (Math, log(max) - Math.log(min) + 1) * this.bucketSize);
            console.log(this._data[i].name + "weight = " + weight);
            this._data[i].weight = weight;
        }
    }
}

_refresh: function () {
    this._prepareData();
    for (var i in this._data) {
        this._createTag(this._data[i]);
    }
}

_createTag: function (tag) {
    dojo.create("div", {innerHTML:tag.name, "class":this.prefix+tag.width}, dojo.byId(this.jd));
}
